<template>
  <div>
    <div style="display: flex;align-items: center;">
      <h2>诊断报表</h2>
      <el-radio-group v-model="radio1" @change="clickChange" size="mini">
        <el-radio-button @click="showAll" label="全部"></el-radio-button>
        <el-radio-button @click="show0" label="门诊"></el-radio-button>
        <el-radio-button @click="show1" label="住院"></el-radio-button>
      </el-radio-group>
    </div>
    <el-row>
      <el-col :span="6">
        <div class="count">
          <div class="p-left">
            <i class="el-icon-notebook-1 icon"></i>
          </div>
          <div class="tot">
            <span>诊断总数</span>
            <el-button @click="toDiagnosis" type="text">{{ countData.total }}</el-button>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="count">
          <div class="f-left">
            <i class="el-icon-coin icon"></i>
          </div>
          <div class="tot">
            <span>应收金额</span>
            <el-button @click="toDiagnosis" type="text">{{ countData.allMoney }}</el-button>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="count">
          <div class="s-left">
            <i class="el-icon-coin icon"></i>
          </div>
          <div class="tot">
            <span>实收金额</span>
            <el-button @click="toDiagnosis" type="text">{{ countData.realMoney }}</el-button>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="count">
          <div class="pr-left">
            <i class="el-icon-close icon"></i>
          </div>
          <div class="tot">
            <span>取消总数</span>
            <el-button @click="toDiagnosis" type="text">{{ countData.allCancel }}</el-button>
          </div>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <div class="followBox">
          <div class="fl-header">
            <span>诊断统计</span>
            <el-button icon="el-icon-close" class="icon-btn"></el-button>
          </div>
          <div id="tabCont" style="height: 300px;width: 550px;"></div>
        </div>
      </el-col>
      <el-col :span="12">
        <div class="followBox">
          <div class="fl-header">
            <span>药品统计</span>
            <el-button icon="el-icon-close" class="icon-btn"></el-button>
          </div>
          <div id="breadCont" style="height: 300px;width: 550px;"></div>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <div class="annulTab">
          <div>
            <div class="annul-header">
              <span>诊断年度报告</span>
              <el-button icon="el-icon-close" class="icon-btn"></el-button>
            </div>
            <div>
              <!-- <el-table :data="tableData" height="250" border style="width: 100%">
                  <el-table-column prop="date" label="日期" width="180">
                  </el-table-column>
                  <el-table-column prop="1" label="1月">
                  </el-table-column>
                  <el-table-column prop="2" label="2月">
                  </el-table-column>
                  <el-table-column prop="2" label="3月">
                  </el-table-column>
                  <el-table-column prop="2" label="4月">
                  </el-table-column>
                  <el-table-column prop="2" label="5月">
                  </el-table-column>
                  <el-table-column prop="2" label="6月">
                  </el-table-column>
                  <el-table-column prop="2" label="7月">
                  </el-table-column>
                  <el-table-column prop="2" label="8月">
                  </el-table-column>
                  <el-table-column prop="2" label="9月">
                  </el-table-column>
                  <el-table-column prop="2" label="10月">
                  </el-table-column>
                  <el-table-column prop="2" label="11月">
                  </el-table-column>
                  <el-table-column prop="2" label="12月">
                  </el-table-column>
                </el-table> -->
              <table class="table table-hover report-tb" cellspacing="0" border="0" id="ctl00_cphMain_GridView1"
                style="border-width:0px;border-collapse:collapse;">
                <tbody>
                  <tr>
                    <th scope="col">日期</th>
                    <th class="report" scope="col">1月</th>
                    <th class="report" scope="col">2月</th>
                    <th class="report" scope="col">3月</th>
                    <th class="report" scope="col">4月</th>
                    <th class="report" scope="col">5月</th>
                    <th class="report" scope="col">6月</th>
                    <th class="report" scope="col">7月</th>
                    <th class="report" scope="col">8月</th>
                    <th class="report" scope="col">9月</th>
                    <th class="report" scope="col">10月</th>
                    <th class="report" scope="col">11月</th>
                    <th class="report" scope="col">12月</th>
                  </tr>
                  <tr>
                    <td>1日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>2日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>3日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>4日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>5日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>6日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>7日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>8日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>9日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>10日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>11日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>12日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>13日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>14日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>15日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>16日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>17日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">1</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>18日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">2</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>19日</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                    <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>20日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">1</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>21日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>22日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>23日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>24日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>25日</td>
                  <td class="report">1</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>26日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>27日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>28日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>29日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>30日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                </tr>
                <tr>
                  <td>31日</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                  <td class="report">-----</td>
                  <td class="report">&nbsp;</td>
                </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import * as echarts from 'echarts'
export default {
  name: '',
  components: {

  },
  data() {
    return {
      radio1: '全部',
      tableData: [],
      countData:{//统计数量
        // "type": 0,
        // "total": 10,//诊断总数
        // "allMoney": 2233,//应收金额
        // "realMoney": 1440,//实收金额
        // "allCancel": 0,//取消总数
        // "name": null,
        // "drugId": null,
        // "month": null
      },
      arr2:[0,0,0,0,0,0,0,0,0,0,0,0],
      arr3:[],
      color3:[],

    }
  },
  created(){
    this.$axios({
      method:'get',
      url:'/diagnosis/diagnosisManagement/countDiagnosis',
      params:{

      }
    })
    .then(resp=>{
      console.log('顶部统计数',resp);
      this.countData=resp.data.data;
      this.draw1Info();
      this.draw2Info();
    })
  },
  methods: {
    toDiagnosis() {//到诊断管理
      this.$router.push('diaManage')
    },
    clickChange(){//切换
      console.log(this.radio1);
      if(this.radio1=='全部'){
        this.showAll()
      }else if(this.radio1=='门诊'){
        this.show0()
      }else{
        this.show1()
      }
    },
    draw1Info(typeId){
      this.$axios({//统计每月所有诊断信息曲线图
        method:'get',
        url:'/diagnosis/diagnosisManagement/countDiagnosisMonthByType',
        params:{
          type:typeId,
        }
      })
      .then(resp=>{
        console.log('按月门诊曲线图',resp.data.data);
        let arr1=[0,0,0,0,0,0,0,0,0,0,0,0];
        let indexArr=[];
        let arr=resp.data.data;
        let res=arr.map((item,index,arr)=>{
            indexArr.push(parseInt((item.month).slice(4,6)))
            return item.total
        })
        for(let i=0;i<indexArr.length;i++){
            arr1.splice(indexArr[i]-1,1,res[i])
        }
        this.arr2=arr1;
        console.log('-----arr2',this.arr2);
        this.draw1();
      })
    },
    draw2Info(typeId){//统计药品信息饼状图
      this.$axios({//统计药品所有信息
        method:'get',
        url:'/diagnosis/diagnosisManagement/countDiagnosisDrugsByType',
        params:{
          type:typeId,
        }
      })
      .then(resp =>{
        console.log(resp.data);
        let my_data=[];
        let res=resp.data.data.map((item,index,arr)=>{
          let obj={value:item.total,name:item.name}
          my_data.push(obj)
          return item.name
        })
        this.arr3=my_data;
        console.log('---arr3',this.arr3);
        let color1=[];
        for(let i=0;i<my_data.length;i++){
          let colorStr=this.getColor()
          color1.push(colorStr)
        }
        this.color3=color1;
        this.draw2()
      })
    },
    showAll(){//全部统计数量
      this.$axios({
        method:'get',
        url:'/diagnosis/diagnosisManagement/countDiagnosis',
        params:{

        }
      })
      .then(resp =>{
        this.countData=resp.data.data;
        this.draw1Info();
        this.draw2Info();
      })
    },
    show0(){
      this.$axios({//门诊统计数
        method:'get',
        url:'/diagnosis/diagnosisManagement/countDiagnosisByType',
        params:{
          
        }
      })
      .then(resp=>{
        console.log('s0',resp.data.data[0]);
        this.countData=resp.data.data[0];
        this.draw1Info(0);//画图1
        this.draw2Info(0);//画图2
        
      })
    },
    show1(){
      this.$axios({//住院统计数
        method:'get',
        url:'/diagnosis/diagnosisManagement/countDiagnosisByType',
        params:{
          
        }
      })
      .then(resp=>{
        console.log('s1',resp.data.data[1]);
        this.countData=resp.data.data[1];
        this.draw1Info(1);//画图1
        this.draw2Info(1);//画图2
        
      })
    },
    getColor(){
      let r = Math.floor(Math.random()*255);
      let g = Math.floor(Math.random()*255);
      let b = Math.floor(Math.random()*255);
      let color = 'rgba('+ r +','+ g +','+ b +',0.8)';
      return color
    },
    draw1() {
      let myChart = echarts.init(document.getElementById('tabCont'))
      myChart.setOption({
        title: { text: '年度诊断统计', left: 'center' },
        xAxis: {
          type: 'category',
          boundaryGap: false
        },
        yAxis: {
          // type: 'category',
          type: 'value',
          show: true,
          boundaryGap: false,
          data: ['0', '5', '10', '15', '20', '25', '30']
        },
        tooltip: {
          show:true,
          trigger: "axis",
        },
        visualMap: {
          type: 'piecewise',
          show: false,
          dimension: 0,
          seriesIndex: 0,
          pieces: [
            {
              gt: 1,
              lt: 3,
              color: '#d4716e'
            },
          ]
        },
        series: [
          {
            type: 'line',
            smooth: true,
            // symbol: 'none',
            lineStyle: {
              color: 'red',
              width: 2
            },
            markLine: {
              symbol: ['none', 'none'],
              label: { show: false },
              data: []
            },
            areaStyle: {},
            data: [
              ['0', 0],
              ['1月', this.arr2[0]],
              ['2月', this.arr2[1]],
              ['3月', this.arr2[2]],
              ['4月', this.arr2[3]],
              ['5月', this.arr2[4]],
              ['6月', this.arr2[5]],
              ['7月', this.arr2[6]],
              ['8月', this.arr2[7]],
              ['9月', this.arr2[8]],
              ['10月', this.arr2[9]],
              ['11月', this.arr2[10]],
              ['12月', this.arr2[11]],
            ]
          }
        ]
      });
    },
    draw2() {
      let myChart = echarts.init(document.getElementById('breadCont'))
      myChart.setOption({
        title: { text: '药品统计', left: 'center' },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          orient: 'vertical',
          left: 'left'
        },
        color: this.color3,
        // color: ['#c23531', '#2f4554'],
        series: [
          {
            // name: 'Access From',
            type: 'pie',
            radius: '50%',
            data: this.arr3,
            // data: [
            //   { value: 67, name: '罗红霉素' },
            //   { value: 33, name: '阿司匹林' },
            //   { value: 33, name: '匹林' },

            // ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    }
  },
  mixins: [],
  props: {

  },
  computed: {

  },
  watch: {

  },

};
</script>
<style scoped>h2 {
  margin: 10px;
}

.count {
  height: 100px;
  background-color: white;
  margin: 10px;
  position: relative;
}

.p-left {
  width: 100px;
  height: 100px;
  position: relative;
  background-color: #00c0ef;
}

.f-left {
  width: 100px;
  height: 100px;
  position: relative;
  background-color: #dd4b39;
}

.s-left {
  width: 100px;
  height: 100px;
  position: relative;
  background-color: #00a65a;
}

.pr-left {
  width: 100px;
  height: 100px;
  position: relative;
  background-color: #f39c12;
}

.tot {
  position: absolute;
  top: 10px;
  left: 110px;
  display: flex;
  flex-direction: column;
}

.icon {
  font-size: 50px;
  color: white;
  position: absolute;
  left: 25px;
  top: 25px;
}

.followBox {
  height: 300px;
  margin: 10px;
  border-top: 3px solid #ccc;
  background-color: rgb(255, 255, 255);
}

.fl-header {
  height: 40px;
  padding-left: 10px;
  padding-right: 10px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn {
  border: none;
}

.annulTab {

  margin-left: 10px;
  margin-right: 10px;
  box-sizing: content-box;
}

.annul-header {
  height: 40px;
  padding-left: 10px;
  padding-right: 10px;
  background-color: rgb(255, 255, 255);
  border-top: 3px solid #ccc;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table{
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  
}
table {
  background-color: transparent;
  border-spacing: 0;
  border-collapse: collapse;
}

th.report {
    text-align: center;
}
.report {
    border-left: solid 1px #F4F4F4;
}
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
    border-top: 1px solid #f4f4f4;
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: top;
    border: 1px solid #ddd;
}
.table th {
    background: url('http://his.mojocube.com/Css/title.png');
}
th {
    text-align: left;
}
</style>